package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity
public class Supplier implements Serializable {

    @Id
    private String supplierId; 
    private String name;
    private Integer contact;
    @OneToOne(cascade = {CascadeType.ALL})
    private Address supplierAddress;
    private String ranking;		//Poor, Moderate, Reliable
    private String comment;
    @OneToMany
    private List<RawMaterial> rawMaterials = new ArrayList<RawMaterial>();
    private String email;
    private String company;

    public Supplier() {
    }

    public Supplier(String supplierId, String name, Integer contact, Address supplierAddress, String ranking, String comment, String email, String company, List<RawMaterial> rawMaterials) {
        this.supplierId = supplierId;
        this.name = name;
        this.contact = contact;
        this.supplierAddress = supplierAddress;
        this.ranking = ranking;
        this.comment = comment;
        this.email = email;
        this.company = company;
        this.rawMaterials = rawMaterials;

    }

    /**
     * @return the supplierId
     */
    public String getSupplierId() {
        return supplierId;
    }

    /**
     * @param supplierId the supplierId to set
     */
    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the contact
     */
    public Integer getContact() {
        return contact;
    }

    /**
     * @param contact the contact to set
     */
    public void setContact(Integer contact) {
        this.contact = contact;
    }

    /**
     * @return the supplierAddress
     */
    public Address getSupplierAddress() {
        return supplierAddress;
    }

    /**
     * @param supplierAddress the supplierAddress to set
     */
    public void setSupplierAddress(Address supplierAddress) {
        this.supplierAddress = supplierAddress;
    }

    /**
     * @return the ranking
     */
    public String getRanking() {
        return ranking;
    }

    /**
     * @param ranking the ranking to set
     */
    public void setRanking(String ranking) {
        this.ranking = ranking;
    }

    /**
     * @return the comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * @param comment the comment to set
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the company
     */
    public String getCompany() {
        return company;
    }

    /**
     * @param company the company to set
     */
    public void setCompany(String company) {
        this.company = company;
    }

    /**
     * @param rawMaterials the rawMaterials to set
     */
    public void setRawMaterials(List<RawMaterial> rawMaterials) {
        this.rawMaterials = rawMaterials;
    }

    /**
     * @return the rawMaterials
     */
    public List<RawMaterial> getRawMaterials() {
        return rawMaterials;
    }
}
